<template>
  <div>
      
      <h1>用户类型:{{ user }}</h1>
  </div>
</template>

<script setup>
import { watch,ref} from "vue"
//props 接收 动态路由参数
const props = defineProps(['acc', 'pwd'])
//定义用户权限变量
const user = ref('')
//监听变量props
watch(props, (newValue, oldValue) => {
  //判断接收的参数是否为管理员
  if (newValue.acc == 'admin') user.value = '管理员'
  else user.value='普通用户'
}, {
  flush: 'pre',
  deep: true,
  immediate:true
})


</script>

<style lang="scss" scoped>

</style>